home *** CD-ROM | disk | FTP | other *** search
/ Space & Astronomy / Space and Astronomy (October 1993).iso / pc / programs / mac / almanac.sit / Almanac v1.8 / card_3076.txt < prev    next >
Text File  |  1990-04-21  |  10KB  |  361 lines

  1. -- card: 3076 from stack: in.8
  2. -- bmap block id: 7383
  3. -- flags: 0000
  4. -- background id: 2765
  5. -- name: Jupiter
  6. ----- HyperTalk script -----
  7. on JFetch
  8.   global force,path
  9.   -- Hard Disk:Astronomy:GE-1990
  10.   put false into npath
  11.   get the script of cd "jupiter"
  12.   put line 3 of it into path
  13.   repeat until number of chars of line 3 of it > 6 and the commandKey is up
  14.     put "Select file for Jupiter Galilean Satellite Events..."
  15.     put filename("TEXT") into path
  16.     if path is empty then exit repeat
  17.     put "  -- "&path into line 3 of it
  18.     set script of cd Jupiter to it
  19.     put true into npath
  20.   end repeat
  21.   hide message box
  22.   put char 1 to 3 of second word of nDate(1,12,0) && first word of nDate(1,12,0) into he
  23.   if not((second word of he) = first word of fld "date") or force or npath then fetch he
  24.   central
  25. end JFetch
  26.  
  27. on central
  28.   set cursor to watch
  29.   put 2*pi into p2
  30.   put pi/180 into fac
  31.   put -2451544.99934 + last word of first line of fld JD into d
  32.   put d/36525+1 into t
  33.   put p2*(frac(.779072+.00273790931*d)) into l0
  34.   put p2*(frac(.993126+.0027377785*d))  into g0
  35.   put p2*(frac(.089608+.00023080893*d)) into l5
  36.   put p2*(frac(.056531+.00023080893*d)) into g5
  37.   put p2*(frac(.882987+.00009294371*d)) into g6
  38.   put ((6910-17*t)*sin(g0)+72*sin(2*g0)-7*cos(g0-g5))/206265+l0 into l
  39.   put 1.00014-.01675*cos(g0)-.00014*cos(2*g0) into r
  40.   put 19934*sin(g5)+5023*t+2511+1093*cos(2*g5-5*g6)+601*sin(2*g5)-479* sin(2*g5-5*g6)-185*sin(2*g5-2*g6)+137*sin(3*g5-5*g6)-131*sin(g5-2*g6) into j
  41.   put -4692*cos(g5)+(30*t+259)*sin(g5)+227-227*cos(2*g5) into b
  42.   put 5.20883-(.00084*t+.25122)*cos(g5)-.00604*cos(2*g5)+.0026*cos(2*g5 -2*g6)-.0017*cos(3*g5-5*g6)-.00106*sin(2*g5-2*g6)-.00091*t*sin(g5) into r5
  43.   add j/206265 to l5
  44.   put b/206265 into b5
  45.   put r5*cos(b5)*sin(l5-l) into n9
  46.   put r5*cos(b5)*cos(l5-l)+r into d9
  47.   put atan(n9/d9) into l1
  48.   if d9<0 then add pi to l1
  49.   put l+l1 into ll
  50.   put n9*n9+d9*d9 into v
  51.   put sqrt(v+(r5*sin(b5))^2) into rr
  52.   put r5*sin(b5)/rr into s
  53.   put atan(s/sqrt(1-s*s)) into bb
  54.   put (84428-47*t)/206265 into e
  55.   put sin(ll)*cos(e)-tan(bb)*sin(e) into n9
  56.   put cos(ll) into d9
  57.   put atanq(d9,n9) into a5
  58.   put sin(bb)*cos(e)+cos(bb)*sin(e)*sin(ll) into s
  59.   put atan(s/sqrt(1-s*s)) into d5
  60.   subtract 1 from t
  61.   put fac*rmod(268.04+.107*t) into a1
  62.   put fac*rmod(64.49-.015*t)  into d1
  63.   put cos(d5)*sin(a1-a5) into d9
  64.   put sin(d1)*cos(d5)*cos(a1-a5)-cos(d1)*sin(d5) into n9
  65.   put atanq(d9,n9)/fac into k
  66.   put 43.3+870.27*(d-.0057755*rr)+1.291*t into w
  67.   put trunc(.5+rmod(w-k)) into clong
  68.   put 22 into GreatRedSpotLong
  69.   put rnd10(rmod(360+GreatRedSpotLong-clong)/36.552917) into nt
  70.   put "Long. Cent. Mer. = "&clong&"┬░"&return&"Red Spot Transits in"&&nt &&"h." into cd fld CL
  71. end central
  72.  
  73. function rmod x
  74. get 360*(x/360-trunc(x/360))
  75. if it<0 then add 360 to it
  76. return it
  77. end rmod
  78.  
  79. on fetch he
  80.   global found,path
  81.   if path is empty then exit fetch
  82.   put false into found
  83.   put "JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC" into months
  84.   if he is empty then exit fetch
  85.   if number of chars of he=5 then put "0" after char 4 of he
  86.   if "--" is in path then delete char 1 to 5 of path
  87.   repeat with month=1 to 12
  88.     if item month of months is in he then exit repeat
  89.   end repeat
  90.   repeat until the number of lines of cd fld total = 0
  91.     select text of cd fld total
  92.     doMenu "Clear Text"
  93.   end repeat
  94.   put month&char 5 to 6 of he into tar
  95.   open file path
  96.   repeat
  97.     set cursor to busy
  98.     read from file path until "&"
  99.     if it is empty then
  100.       exit repeat
  101.     end if
  102.     delete last char of it
  103.     if it contains tar then
  104.       exit repeat
  105.     end if
  106.     if tar < char 4 to 7 of line 2 of it then
  107.       get empty
  108.       exit repeat
  109.     end if
  110.   end repeat
  111.   close file path
  112.   put the number of lines of it into she
  113.   if she = 0 then
  114.     -- next search
  115.     if not (the target contains "Next") then
  116.       put "No Galilean Satellite Events for "& he into line 4 of cd fld total
  117.     end if
  118.     exit fetch
  119.   end if
  120.   if not (the target contains "Next") then
  121.     put line 1 of it && return into cd fld total
  122.     put "DATE   Time(UT) SP Radii" & return into line 2 of cd fld total
  123.   end if
  124.   repeat with i=2 to she
  125.     put "(not visible)" into temp
  126.     put word 3 of line i of it into time
  127.     put (line 4 of fld rise + .5) mod 24 into jr
  128.     put (line 5 of fld rise - .5) mod 24 into js
  129.     put (char 1 to 2 of time+(char 4 to 5 of time)/60+24-DSTcheck()) mod 24 into time
  130.     put line 4 of fld rise of cd sun - .5 into str
  131.     put line 5 of fld rise of cd sun + .5 into sts
  132.     if time <str or time >sts then
  133.       put jr>time into a
  134.       put js>time into b
  135.       -- change 12's to 11.5, 12.5
  136.       put jr>11.5 into c
  137.       put js>12.5 into d
  138.       if (a is b) and (c and not d) then
  139.         put empty into temp
  140.       else if (c is d) and (b and not a) then
  141.         put empty into temp
  142.       else if (b is d) and not (a is c) then
  143.         put empty into temp
  144.       end if
  145.     end if
  146.     if (the target contains "Next" and temp is empty and cd fld total is empty) then
  147.       put line 1 of it && return&"DATE   Time(UT) SP Radii" & return into cd fld total
  148.     end if
  149.     if not (the target contains "Next") or (the target contains "Next" and temp is empty) then put item month of months&&char 5 to 6 of he&&word 3 of line i of it &&" "&word 1 of line i of it&&(word 4 of line i of it)/10 && temp & return after cd fld total
  150.     if temp is empty then put true into found
  151.   end repeat
  152.   ftype "Total",6
  153. end fetch
  154.  
  155.  
  156. -- part 16 (button)
  157. -- low flags: 00
  158. -- high flags: 0000
  159. -- rect: left=398 top=181 right=205 bottom=437
  160. -- title width / last selected line: 0
  161. -- icon id / first selected line: 31949 / 31949
  162. -- text alignment: 1
  163. -- font id: 0
  164. -- text size: 12
  165. -- style flags: 0
  166. -- line height: 16
  167. -- part name: Satellite
  168. ----- HyperTalk script -----
  169. on mouseUp
  170.   get the seconds
  171.   add DSTcheck()*3600 to it
  172.   convert it to dateitems
  173.   put item 1 of it into line 3 of joe
  174.   put item 2 of it into line 1 of joe
  175.   put item 3 of it +(item 4 of it)/24 + (item 5 of it)/1440 into line 2 of joe
  176.   PutClipboard(joe)
  177.   open "JSAT"
  178. end mouseUp
  179.  
  180.  
  181.  
  182. -- part 18 (field)
  183. -- low flags: 00
  184. -- high flags: 0002
  185. -- rect: left=41 top=184 right=283 bottom=348
  186. -- title width / last selected line: 0
  187. -- icon id / first selected line: 0 / 0
  188. -- text alignment: 0
  189. -- font id: 15036
  190. -- text size: 12
  191. -- style flags: 0
  192. -- line height: 16
  193. -- part name: total
  194.  
  195.  
  196. -- part 19 (button)
  197. -- low flags: 00
  198. -- high flags: 8003
  199. -- rect: left=6 top=313 right=334 bottom=87
  200. -- title width / last selected line: 0
  201. -- icon id / first selected line: 0 / 0
  202. -- text alignment: 1
  203. -- font id: 0
  204. -- text size: 12
  205. -- style flags: 0
  206. -- line height: 16
  207. -- part name: Today
  208. ----- HyperTalk script -----
  209. on mouseUp
  210.   put char 1 to 3 of second word of nDate(1,12,0) && first word of nDate(1,12,0) into he
  211.   fetch he
  212. end mouseUp
  213.  
  214.  
  215.  
  216. -- part 20 (button)
  217. -- low flags: 00
  218. -- high flags: 8003
  219. -- rect: left=283 top=313 right=334 bottom=364
  220. -- title width / last selected line: 0
  221. -- icon id / first selected line: 0 / 0
  222. -- text alignment: 1
  223. -- font id: 0
  224. -- text size: 12
  225. -- style flags: 0
  226. -- line height: 16
  227. -- part name: Other Days
  228. ----- HyperTalk script -----
  229. on mouseUp
  230.   Ask "Enter date (mon dd):"
  231.   put it into he
  232.   fetch he
  233. end mouseUp
  234.  
  235.  
  236.  
  237. -- part 21 (button)
  238. -- low flags: 00
  239. -- high flags: A003
  240. -- rect: left=90 top=313 right=334 bottom=171
  241. -- title width / last selected line: 0
  242. -- icon id / first selected line: 0 / 0
  243. -- text alignment: 1
  244. -- font id: 0
  245. -- text size: 12
  246. -- style flags: 0
  247. -- line height: 16
  248. -- part name: Tomorrow
  249. ----- HyperTalk script -----
  250. on mouseUp
  251.   put char 1 to 3 of second word of nDate(1,12,1) && first word of nDate(1,12,1) into he
  252.   fetch he
  253. end mouseUp
  254.  
  255.  
  256.  
  257.  
  258. -- part 22 (button)
  259. -- low flags: 00
  260. -- high flags: 8003
  261. -- rect: left=375 top=313 right=334 bottom=460
  262. -- title width / last selected line: 0
  263. -- icon id / first selected line: 0 / 0
  264. -- text alignment: 1
  265. -- font id: 0
  266. -- text size: 12
  267. -- style flags: 0
  268. -- line height: 16
  269. -- part name: Next Event
  270. ----- HyperTalk script -----
  271. on mouseUp
  272.   global found
  273.   put 0 into n
  274.   put false into found
  275.   repeat until found
  276.     add 1 to n
  277.     put char 1 to 3 of word 2 of nDate(1,12,n) && word 1 of nDate(1,12,n) into he
  278.     fetch he
  279.   end repeat
  280. end mouseUp
  281.  
  282.  
  283.  
  284.  
  285. -- part 23 (field)
  286. -- low flags: 00
  287. -- high flags: 0002
  288. -- rect: left=38 top=142 right=179 bottom=180
  289. -- title width / last selected line: 0
  290. -- icon id / first selected line: 0 / 0
  291. -- text alignment: 0
  292. -- font id: 15026
  293. -- text size: 12
  294. -- style flags: 0
  295. -- line height: 16
  296. -- part name: CL
  297.  
  298.  
  299. -- part contents for background part 7
  300. ----- text -----
  301. Sidereal Time = 5:22
  302. 5.367408
  303.  
  304. -- part contents for background part 10
  305. ----- text -----
  306. Jupiter R.A. = 6h 23m
  307. Jupiter Dec.  = +23┬░ 26'
  308. Az. = 123
  309. Alt. = 73
  310. 95.998917
  311. 23.4367471
  312.  
  313. -- part contents for background part 6
  314. ----- text -----
  315. Universal Time = 20:58
  316. 20.9786111
  317. 111
  318.  
  319. -- part contents for background part 13
  320. ----- text -----
  321. Jupiter Rises at 10:53 AM
  322. Jupiter Sets  at 1:07 AM
  323. 42.0114749
  324. 10.8966107
  325. 1.1263391
  326.  
  327. -- part contents for background part 14
  328. ----- text -----
  329. Jupiter
  330.  
  331. -- part contents for background part 31
  332. ----- text -----
  333. Julian Date = 2448003.374
  334.  
  335. -- part contents for background part 39
  336. ----- text -----
  337.  11%-
  338.  
  339. -- part contents for card part 23
  340. ----- text -----
  341. Long. Cent. Mer. = 244┬░
  342. Red Spot Transits in 3.8 h.
  343.  
  344. -- part contents for background part 8
  345. ----- text -----
  346. 15.0978223 1.6926094 .1308392 -.4104462 .0019488 .0065146 -.0074204 .0067368 -.0003988 .0003602 .0001924 -.0001389 .0000391 -.0000176 .0000024 .0000034 .0000063 -.0000012 .0000056 -.0000025 -.0000007 -.0000018 -.0000064 .0000018 -.0000047 .0000027 .0000024 .0000005 .0000055 -.0000031 -.000003 -.0000005 
  347.  
  348. -- part contents for background part 9
  349. ----- text -----
  350. 41.818303 -3.456391 -.761541 .77627 .470506 .020993 -.061472 -.005634 -.004469 -.003138 .001264 -.00013 .000114 .000095 -.000061 .000001 -.000031 -.000009 -.000008 .000003 .000014 .000019 .000023 .000014 .000006 -.000001 -.000019 -.000011 -.000014 .000002 .00002 .00001 
  351.  
  352. -- part contents for background part 28
  353. ----- text -----
  354. 22 April 1990 (JT)
  355.  
  356. -- part contents for card part 18
  357. ----- text -----
  358. JUPITER SATELLITE ECLIPSE EVENTS 
  359. DATE   Time(UT) SP Radii
  360. APR 22 04:42.5  1R 1 
  361.